import com.adobe.cairngorm.control.CairngormEventDispatcher;

import net.optix.ip.events.SetBudgetEvent;
import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.BidVO;
[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

private function initApp():void
{
	
}

private function setBudget(event:MouseEvent):void
{
	var myEvent:SetBudgetEvent;
	var vo:BidVO	=	new BidVO();
	vo.id			=	model.currentTradeMark.tradeMarkID;
	vo.firmID		=	model.firm.firmID;
	vo.type			=	0;
	
	switch(event.target.label)
	{
		case "Bid":
			vo.budget	=	int(budget.text);
			myEvent	=	new SetBudgetEvent(vo);
			break;
		case "No Bid":
			vo.budget	=	-1;
			myEvent	=	new SetBudgetEvent(vo);
			break;
	}
	CairngormEventDispatcher.getInstance().dispatchEvent(myEvent);
}